package cn.jsu.oj.dispatchServer.dataStructure;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author ahtonc
 */
public class MappingQueue<T> extends MessageQueue<T> {
    private AtomicInteger weight;

    public MappingQueue(int initSize) {
        super(initSize);
        this.weight = new AtomicInteger(0);
    }

    public int getWeight() {
        return weight.get();
    }

    public void setWeight(int weight) {
        this.weight.set(weight);
    }

    public void changeWeight(int weight) {
        this.weight.addAndGet(weight);
    }
}
